import VueRouter from 'vue-router'

import home from './components/tabbar/Home.vue'
import member from './components/tabbar/Member.vue'
import shopcar from './components/tabbar/Shopcar.vue'
import search from './components/tabbar/Search.vue'
import newslist from './components/news/Newslist.vue'
import newsInfo from './components/news/Newsinfo.vue'
import photolist from './components/photoshare/Photolist.vue'
import photoinfo from './components/photoshare/Photoinfo.vue'
import goodslist from './components/goods/Goodslist.vue'
import goodsinfo from './components/goods/Goodsinfo.vue'
import goodsdesc from './components/goods/Goodsdesc.vue'
import goodscmts from './components/goods/Goodscmts.vue'

// 3. 路由对象
var router = new VueRouter({
  routes: [
    {path:'/',redirect:'/home'},
    {path:'/home',component:home},
    {path:'/member',component:member},
    {path:'/shopcar',component:shopcar},
    {path:'/search',component:search},
    {path:'/home/newslist',component:newslist},
    {path:'/home/newslist/newsInfo/:newid',component:newsInfo},
    {path:'/home/photolist',component:photolist},
    {path:'/home/photolist/photoinfo/:photoid',component:photoinfo},
    {path:'/home/goodslist',component:goodslist},
    {path:'/home/goodslist/goodsinfo/:goodsid',component:goodsinfo,name:'goodsinfo'},
    {path:'/home/goodslist/goodsdesc/:descid',component:goodsdesc,name:'goodsdesc'},
    {path:'/home/goodslist/goodscmts/:cmtsid',component:goodscmts,name:'goodscmts'}
  ],
  linkActiveClass:'mui-active'// 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
})

// 把路由对象暴露出去
export default router